/** 产品管理 */
import httpRequest from '@/utils/httpRequest'

// 根据id获取产品详情
export function getById (data) {
  return httpRequest({
    url: '/basis/product/product',
    method: 'get',
    params: data
  })
}
// 产品目录校验重复
export function checkRepeat (data) {
    return httpRequest({
        url: '/basis/product/productCategory/checkRepeat',
        method: 'post',
        data: data,
        headers: {'Content-Type': 'application/json; charset=utf-8'}
    })
}
// 产品目录加载接口
export function getTreeData (data) {
  return httpRequest({
    url: '/basis/product/productCategory/treeData',
    method: 'get',
    params: data
  })
}
export function getCategory (data) {
  return httpRequest({
    url: '/basis/product/productCategory/get',
    method: 'get',
    params: data
  })
}
// 产品目录添加或修改
export function editTreeData (data) {
  return httpRequest({
    url: '/basis/product/productCategory/save',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 产品目录删除
export function delTreeData (data) {
  return httpRequest({
    url: '/basis/product/productCategory/delete',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 检查产品是否被业务使用
export function isCheck (data) {
  return httpRequest({
    url: '/basis/product/product/isCheck',
    method: 'get',
    params: data
  })
}
// 获取产品列表
export function getList (data) {
  return httpRequest({
    url: '/basis/product/product/list',
    method: 'get',
    params: data
  })
}
// 新增产品或修改产品
export function edit (data) {
  return httpRequest({
    url: '/basis/product/product',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 修改产品状态
export function editState (data) {
  return httpRequest({
    url: '/basis/product/product/updateStatus',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 删除产品
export function delProduct (data) {
  return httpRequest({
    url: '/basis/product/product/delete',
    method: 'post',
    data: data
  })
}
// 设置复磅
export function repeateMeasure (data) {
  return httpRequest({
    url: '/basis/product/product/repeateMeasure',
    method: 'post',
    data: data
  })
}
